/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.ex;

import org.jsoup.Jsoup;

import java.io.IOException;
import java.util.regex.Pattern;

/**
 * <p>Project: javase - Ex5
 * <p>Powered by webrx On 2021-12-08 09:48:17
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex5 {
    public static void main(String[] args) throws IOException {
        String phone = "13033577066";
        String u = String.format("https://www.ip138.com/mobile.asp?mobile=%s&action=mobile", phone);
        //String h = Jsoup.connect(u).get().select("td>span").get(1).text();
        //System.out.println(h);

        String h = Jsoup.connect(u).get().toString();
        var p = Pattern.compile("<td><span>(.+)&nbsp;(.+)</span></td>");
        var m = p.matcher(h);
        while (m.find()) {
            System.out.println(m.group(1) + m.group(2));
        }
    }

}
